home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Floppyshop 2
/
Floppyshop - 2.zip
/
Floppyshop - 2.iso
/
diskmags
/
0022-3.564
/
dmg-3557
/
news.txt
/
pound.asc
< prev
next >
Wrap
Text File
|
1997-06-21
|
10KB
|
187 lines
°∙°∙°∙°∙°∙°∙°∙°∙°∙°∙°∙°∙
∙ THE ELUSIVE £ SIGN ∙
∙ ∙
∙ by Martyn Dryden ∙
∙ ∙
°∙°∙°∙°∙°∙°∙°∙°∙°∙°∙°∙°∙
It seems somehow appropriate that just as actual pounds sterling can be
difficult to obtain in real life, so the £ symbol can be difficult to
print in the world of computing. I can't help you with obtaining pounds
sterling, but the printing of the £ symbol is one of the problems most
commonly encountered in queries from users. If this is your problem,
then read on.
First a little background. The Atari ST can normally display 256
different characters on screen (including blanks) and we number them 0 to
255 in decimal numbers, or $00 to $FF in hex (decimal 15 = hex $0F). Of
these, the characters from 32 to 128 ($20 to $7F) are standardised across
all computers and printers, and are known as the ASCII character set
(American Standard Code for Information Interchange).
Difficulties with the pound sign arise from the fact that it doesn't
form part of the standard ASCII set. The second 128 characters ($80 to
$FF) are not standardised, and manufacturers have assigned them in many
different ways.
If you inspect the ST's character set (displayed in the FirstWord
program, for example), you will see the £ sign at position $9C (156 in
real money). The £ sign may be character $9C on your printer, too, in
which case you may be wondering what all the fuss is about. But your
printer may have a different character set (many printers have several
alternative sets, selected either in software or by DIP switch, or both).
Your printer's character $9C could equally well be a Greek letter, a
graphic symbol, or a blank, in which case that is what you will get when
you try to print a pound sign.
The pound sign on your printer may be at character $9C in one of its
character sets - in fact, if your printer supports IBM Character Set No
2, then that's where you will find it. In this case, to print a £ you
must first activate IBM Character Set 2. Once this is done, sending a £
($9C) from your wordprocessor will print a £. (See Method 1, below.)
Another popular location is $86 (134 decimal) in the standard character
set. In this case, to print a £ you just need to make your WP send
character number $86 instead of $9C. (See Method 2, below.)
Printers also offer a choice of national language character sets. The
national language character set is a small sub-set of characters, usually
12, which can be varied. The pound sign is one of these: it shares
character number 35 ($23 hex) with the # sign (usually known as a hash
sign, although in the USA confusingly called a pound sign). In this
case, to print a £ you must first activate the UK national character set.
Once this is done, sending a # ($23) from your wordprocessor will print a
£. (See Method 3, below.)
Your printer's manual will contain a listing or table showing all the
characters that it can print, in its various character sets, along with
their codes (0 to 256). Different printers have very different capabili-
ties. Some may have several different alternative character sets
(sometimes known as code pages). At the other extreme, outdated and/or
low cost printers may only have characters up to number 127, in which
case characters above 128 may be bold or italic versions of the same
characters.
You can switch between character sets, if necessary, either by software
(sending the necessary control codes to the printer) or by DIP switch.
Instructions will be in the printer manual. Unfortunately, these manuals
are rarely models of clarity.
Method 1
°∙°∙°∙°∙
Activate the character set in which the £ sign is character number $9C
- frequently described as IBM Character Set 2.
With most printers, there is no method of selecting IBM mode in
software: it is a DIP switch selection, an alternative to the printer's
default mode. However, since the majority of software supports an IBM
printer, leaving your printer in this mode shouldn't cause any problems.
Once in IBM mode, the selection of Character Set 2 can be done either
in software (by sending control codes) or by DIP switch. The control
codes are normally given in the manual as ESC "6" ($1B, $36) to select
character set 2, and ESC "7" ($1B, $37) to revert to character set 1.
You will almost certainly be staying with character set 2, as it's by
far the more useful character set. It's simplest to use DIP switch
selection. Alternatively you can make your WP select character set 2
when it starts up, by including ESC "6" in the initialisation sequence.
Method 2
°∙°∙°∙°∙
To make your WP send character number $86 instead of $9C, you will need
to adjust the printer driver. The way to do this depends on which WP
you're using. Assuming that a commercial WP comes with full instructions
(or, preferably, a pre-set driver for your printer), let's look at the
two favourite free WPs, FirstWord and STWriter.
For FirstWord (and indeed FirstWord Plus), you have to edit the .HEX
file, a text file containing the printer control codes expressed as hex
numbers. You then run the INSTALL.PRG on the edited .HEX file, to create
a small file called 1ST_PRNT.DOT (or 1ST_PRNT.DSY for a daisy-wheel
printer). This file will be read by the program when you start to print.
The .HEX file normally contains plenty of comments which will help you
navigate through it. Your aim is to create (or modify) entry $9C in the
'character substitution table', which is the last part of the file. These
entries must be in numerical order, but they don't all have to exist, so
make sure you insert the entry in the right place if it isn't there
already.
The entry consists of:
9C, 86 * char $86 is a pound sign on my printer
viz: the character you want to replace, the character with which to
replace it, and a comment to remind yourself what you did and why.
Do not forget to save your file in non-WP mode (the WP mode item in the
Edit menu must NOT be ticked).
With STWriter, the idea is similar: you edit the file CONFIG.TXT, and
then run the program CONFIG.TOS, which creates a data file XYZZX.DAT
(don't ask!). The main difference is that in FirstWord the entries are
optional and can be any length, but STWriter requires them all to be
present, and only one character long. You must therefore find the $9Cth
(156th) entry in the substitution table and replace it with $86.
Method 3
°∙°∙°∙°∙
Activate the UK national character set, and then send a # ($23) from
your wordprocessor.
You can select the character set using DIP switches, and then just
substitute $23 for character $9C, using the method described above.
However, in this case you will ONLY be able to use the UK character
set. You won't be able to print a #, for example, or any of the other
national replacement characters, such as European accented characters.
It's more flexible to switch character sets on a per-character basis.
To do so we extend the method described above, to include the character
set commands in the printer driver file. In FirstWord, for example:
9C, 1B, 52, 03, 23 * £ from UK character set
This means that character 9C is substituted by a string of four
characters: ESC "R" $03 $23. The first three of these are the command
to select the UK character set: ESC "R" n, where n is 3 for the UK. The
last is the hash symbol.
If you want to be able to print a hash then you need to switch back to
the US character set for this character, and so you will need another
entry (remember to keep them in order!):
23, 1B, 52, 00, 23 * # from US character set
To get the full benefit of this, with access to all of the national
character sets, you must do the same for the other characters that can be
replaced in this way. For example, activating the French character set
and sending a left curly bracket ($7B) produces a lower case e-acute
($82). To organise this, do as follows:
7B, 1B, 52, 00, 7B * left curly bracket from US char set
82, 1B, 52, 01, 7B * e acute from French character set
By spending a few hours poring over your printer manual, editing the
.HEX file and running it through the INSTALL program, with a little luck
you will find that you can print every character that you can type - all
256 of them. No more embarrassing blanks or mysterious characters in
your documents!
Just as important, you'll have learned a good deal about your printer
and how to get the most from it, profiting from your investment and happy
with your hardware.
~~~~~eof~~~~~